<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .white{
            background-color: white;
        }
        .beige{
            background-color: beige;
        }
    </style>
</head>
<body>
   <h3 align="center">员工列表</h3>
    <table align="center" width="60%" border="1px">
        <tr>
            <th>员工编号</th>
            <th>员工姓名</th>
            <th>员工薪水</th>
            <th>status.even</th>
            <th>status.count</th>
            <th>操作</th>
        </tr>
        <tr th:each="emp,status:${pageInfo.list}" th:class="${status.even?'white':'beige'}">
            <td th:text="${emp.empId}"></td>
            <td th:text="${emp.empName}"></td>
            <td th:text="${emp.empSalary}"></td>
            <td th:text="${status.even}"></td>
            <td th:text="${status.count}"></td>
            <td>修改  删除</td>
        </tr>
        <tr>
            <td colspan="10" style="text-align: center">
                <a th:href="@{/employee/findByPage(pageNum=1)}">首页</a>
                <span th:if="${pageInfo.pageNum!=1}">
                    <a th:href="@{/employee/findByPage(pageNum=${pageInfo.prePage})}">上一页</a>
                </span>

                <span th:each="num:${pageInfo.navigatepageNums}">
                    <a th:if="${num!=pageInfo.pageNum}" th:href="@{/employee/findByPage(pageNum=${num})}" th:text="${num}"></a>
                    <a th:if="${num==pageInfo.pageNum}" th:href="@{/employee/findByPage(pageNum=${num})}" th:text="|[${num}]|"></a>
                </span>
                <span th:if="${pageInfo.pageNum!=pageInfo.pages}">
                    <a th:href="@{/employee/findByPage(pageNum=${pageInfo.nextPage})}">下一页</a>
                </span>

                <a th:href="@{/employee/findByPage(pageNum=${pageInfo.pages})}">末页</a>

                每页<span th:text="${pageInfo.pageSize}"></span>条记录
            </td>
        </tr>
        <tr>
            <td colspan="10" style="text-align: center">
                <a th:href="@{/employee/toAdd}">添加员工</a>
            </td>
        </tr>
    </table>
</body>
</html>